Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(common): implement Datum::[from|to]_protobuf #12679

Merged
merged 2 commits into from
Oct 8, 2023

Conversation

BugenZhao
Copy link
Member

@BugenZhao BugenZhao commented Oct 8, 2023

Signed-off-by: Bugen Zhao [email protected]I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

To avoid writing serialization/deserialization logic explicitly. 💦

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
@BugenZhao BugenZhao requested a review from a team as a code owner October 8, 2023 09:09
@codecov
Copy link

codecov bot commented Oct 8, 2023

Codecov Report

Merging #12679 (ed35e52) into main (437d36e) will decrease coverage by 0.08%.
Report is 3 commits behind head on main.
The diff coverage is 91.11%.

@@            Coverage Diff             @@
##             main   #12679      +/-   ##
==========================================
- Coverage   69.40%   69.33%   -0.08%     
==========================================
  Files        1470     1470              
  Lines      241531   241523       -8     
==========================================
- Hits       167637   167449     -188     
- Misses      73894    74074     +180     
Flag Coverage Δ
rust 69.33% <91.11%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/common/src/types/mod.rs 72.81% <100.00%> (-0.07%) ⬇️
src/common/src/util/memcmp_encoding.rs 91.41% <100.00%> (+0.03%) ⬆️
src/common/src/util/value_encoding/mod.rs 92.97% <100.00%> (+0.16%) ⬆️
src/expr/core/src/expr/expr_field.rs 84.68% <100.00%> (ø)
src/expr/core/src/expr/expr_in.rs 98.43% <100.00%> (-0.04%) ⬇️
src/expr/core/src/expr/expr_literal.rs 99.35% <100.00%> (ø)
src/expr/core/src/expr/test_utils.rs 84.51% <100.00%> (ø)
src/frontend/src/expr/literal.rs 91.89% <100.00%> (-0.29%) ⬇️
src/expr/core/src/aggregate/def.rs 69.66% <0.00%> (+1.29%) ⬆️
...rc/frontend/src/optimizer/plan_node/generic/agg.rs 92.21% <0.00%> (+0.32%) ⬆️
... and 1 more

... and 21 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment on lines -433 to +434
let struct_none = None;
let struct_1 = Some(
let struct_none = Datum::None;
let struct_1 = Datum::Some(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why bother change this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to auto_impl(&), it seems the type inference will fail as we use .into() in Some(..). 🤣

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think Datum::None/Datum::Some can be a good practice, although changing one place doesn't make big difference in regard to maintainability.

@BugenZhao BugenZhao added this pull request to the merge queue Oct 8, 2023
@BugenZhao BugenZhao removed this pull request from the merge queue due to a manual request Oct 8, 2023
Copy link
Member

@stdrc stdrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines -433 to +434
let struct_none = None;
let struct_1 = Some(
let struct_none = Datum::None;
let struct_1 = Datum::Some(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think Datum::None/Datum::Some can be a good practice, although changing one place doesn't make big difference in regard to maintainability.

@stdrc stdrc added this pull request to the merge queue Oct 8, 2023
Merged via the queue into main with commit 8b18a7e Oct 8, 2023
11 of 12 checks passed
@stdrc stdrc deleted the bz/datum-from-to-protobuf branch October 8, 2023 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants